package com.lyh.common.enums;

/**
 *  描述：订单状态
 *
 * @Author：Ljx
 * @Date 2023/5/23 22:08
 * @Return
**/
public enum StoreOrderStatusEnum {

    wait_send(1,"待发货"),
    wait_pay(2,"待付款"),
    alrealy_send(3,"已发货"),
    refund_on(4,"退款中"),
    success(5,"交易成功"),
    fail(6,"交易失败"),
    refund_success(7,"退款成功");

    Integer code;
    String msg;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    StoreOrderStatusEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static StoreOrderStatusEnum getEnum(Integer code) {
        for (StoreOrderStatusEnum el : StoreOrderStatusEnum.values()) {
            if (el.getCode()==code) {
                return el;
            }
        }

        return null;
    }
}
